package com.uuj.project.uiview;

import android.app.ProgressDialog;
import android.content.Context;
import android.os.Bundle;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.uuj.project.R;


/**
 * Created by Administrator on 2017/1/3.
 * 界面加载的dialog
 */

public class LoadDialog extends ProgressDialog {
    private ImageView mImageView;//图片集合
    private Context context;

    public LoadDialog(Context context) {
        this(context, R.style.user_default_dialog);
    }

    private LoadDialog(Context context, int theme) {
        super(context, theme);
        this.context = context;
        //触摸动画之外的地方是否取消动画，这里设置为false不取消
        setCanceledOnTouchOutside(false);
        //setCancelable(false);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_load);
        initView();
        initData();
    }

    /**
     * 初始化数据
     */
    private void initData() {
        Glide.with(context).load(R.mipmap.loading_gif).into(mImageView);
    }

    /**
     * 初始化控件
     */
    private void initView() {
        mImageView = findViewById(R.id.load_image);
    }
}
